package com.shuiyun.jtt.message.mapping;

import com.shuiyun.jtt.message.attributes.LocationAreaOverSpeed;
import com.shuiyun.jtt.message.attributes.LocationPassingArea;
import com.shuiyun.jtt.message.attributes.LocationTravelTimeAlarm;
import com.shuiyun.jtt.message.schema.*;
import lombok.NoArgsConstructor;

/**
 * @author shuiyun
 * @program device-simulator
 * @description 定位附加信息
 * @date 2022-04-25 22:54
 **/
public class LocationAttributes extends DataTypeMapping {

    @Override
    protected void addSchemas(DataTypeMapping schemaRegistry) {
        schemaRegistry
                .addMapping(0x01, DWordSchema.INSTANCE)
                .addMapping(0x02, WordSchema.INSTANCE)
                .addMapping(0x03, WordSchema.INSTANCE)
                .addMapping(0x04, WordSchema.INSTANCE)
                .addMapping(0x05, BytesSchema.INSTANCE)
                .addMapping(0x06, WordSchema.INSTANCE)
                .addMapping(0x11, new ObjectSchema(LocationAreaOverSpeed.class))
                .addMapping(0x12, new ObjectSchema(LocationPassingArea.class))
                .addMapping(0x13, new ObjectSchema(LocationTravelTimeAlarm.class))
                .addMapping(0x25, DWordSchema.INSTANCE)
                .addMapping(0x2A, WordSchema.INSTANCE)
                .addMapping(0x2B, DWordSchema.INSTANCE)
                .addMapping(0x30, ByteSchema.INSTANCE)
                .addMapping(0x31, ByteSchema.INSTANCE);
    }
}
